home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cbibcode.arc / SETDATE.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-05  |  472 b   |  18 lines

  1. /* SETDATE.C --- p. 663 */
  2. #include <stdio.h>
  3. #include <dos.h>
  4. main()
  5. {
  6.     int month, day, year;
  7.     struct date date;
  8.     printf("Enter new date in the form MM/DD/YY:");
  9.     scanf("%d/%d/%d", &month, &day, &year);
  10.                 /* Set up the files of the date structure */
  11.     date.da_day = day;
  12.     date.da_mon = month;
  13.     date.da_year = year + 1900;
  14.                 /* Set the new date */
  15.     setdate(&date);
  16.     printf("New date: %d/%d/%d\n", date.da_mon,
  17.                     date.da_day, date.da_year - 1900);
  18. }